<template>
  <div>
        <h1>Link 链接</h1>
        <p>文字超链接</p>
        <div>
            <h2>基础用法</h2>
            <p>基础的文字链接用法。</p>
            <p>通过 underline 来设置是否带有下划线，默认不带下划线，接受一个 Boolean 类型的值。</p>
            <div class="preview-box">
                <div style="padding:20px">
                    <div class="flex-start">
                        <mo-link @click="test">Default</mo-link>
                        <mo-link type="success" href="http://www.baidu.com" blank style="margin-left:10px">Success</mo-link>
                        <mo-link type="primary" style="margin-left:10px">Primary</mo-link>
                        <mo-link type="info" style="margin-left:10px">Info</mo-link>
                        <mo-link type="warning" style="margin-left:10px">Warning</mo-link>
                        <mo-link type="error" style="margin-left:10px">Error</mo-link>
                        <mo-link type="dark" style="margin-left:10px">Dark</mo-link>
                    </div>

                     <div class="flex-start" style="margin-top:20px">
                        <mo-link underline>Default</mo-link>
                        <mo-link type="success" underline style="margin-left:10px">Success</mo-link>
                        <mo-link type="primary" underline style="margin-left:10px">Primary</mo-link>
                        <mo-link type="info" underline style="margin-left:10px">Info</mo-link>
                        <mo-link type="warning" underline style="margin-left:10px">Warning</mo-link>
                        <mo-link type="error" underline style="margin-left:10px">Error</mo-link>
                        <mo-link type="dark" underline style="margin-left:10px">Dark</mo-link>
                    </div>

                </div>
                <div class="code-box" v-show="button1">
                    <pre v-highlight><code class="html">{{ code1 }}</code></pre>  
                </div>
                <div class="preview-code flex-center">
                    <el-link :underline="false" @click="button1=!button1">
                        {{button1?'隐藏源代码':'查看源代码'}}
                    </el-link>
                </div>
            </div>
        </div>

        <div>
            <h2>禁用状态</h2>
            <p>使用 disabled 属性来控制按钮是否为禁用状态。 该属性接受一个 Boolean 类型的值。</p>
            <div class="preview-box">
                <div style="padding:20px">
                    <div class="flex-start">
                        <mo-link disabled href="http://www.baidu.com">Default</mo-link>
                        <mo-link type="success" disabled style="margin-left:10px">Success</mo-link>
                        <mo-link type="primary" disabled style="margin-left:10px">Primary</mo-link>
                        <mo-link type="info" disabled style="margin-left:10px">Info</mo-link>
                        <mo-link type="warning" disabled style="margin-left:10px">Warning</mo-link>
                        <mo-link type="error" disabled style="margin-left:10px">Error</mo-link>
                        <mo-link type="dark" disabled style="margin-left:10px">Dark</mo-link>
                    </div>
                </div>
                <div class="code-box" v-show="button2">
                    <pre v-highlight><code class="html">{{ code2 }}</code></pre>  
                </div>
                <div class="preview-code flex-center">
                    <el-link :underline="false" @click="button2=!button2">
                        {{button2?'隐藏源代码':'查看源代码'}}
                    </el-link>
                </div>
            </div>
        </div>

        <div>
            <h2>属性</h2>
             <el-table 
                :data="attrList" 
                style="width: 800px"
                :header-cell-style="{background:'#f5f7fa',color:'#606266'}">
                    <el-table-column property="attr" label="属性"/>
                    <el-table-column property="desc" label="描述" />
                    <el-table-column property="type" label="类型"/>
                    <el-table-column property="opt" label="可选值" />
                    <el-table-column property="default" label="默认值"/>
             </el-table>
        </div>
       
    </div>
</template>

<script>
import { computed, reactive, ref, toRefs } from 'vue';
import code from '@/views/component/link/code';
import attrs from '@/views/component/link/attrs';
export default {
    name: 'link',
    components: {},
    props: {},
    emits: [],
    setup () 
    {
        let data = reactive({
            button1:false,
            button2:false,
            button3:false
        });

        function test ()
        {
            console.log(1233313);
        }
        
        return {
            ...code,
            ...toRefs(data),
            ...attrs,
            test
        };
    }
};

</script>
<style lang='scss' scoped>
</style>
